<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>VueComponent</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="root">
    <school></school>
</div>
<script>
    Vue.config.productionTip = false;
    // 1. 创建组件
    // 创建school组件
    const school = Vue.extend({
        template: `
          <div>
          <h2>学校名称：{{ schoolName }}</h2>
          <h2>学校地址：{{ address }}</h2>
          </div>
        `,
        data() {
            return {
                schoolName: '西工大',
                address: '长安校区'
            };
        }
    });
    new Vue({
        el: '#root',
        components: {
            school
        }
    });
</script>
</body>
</html>